<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditPatientTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditPatientLabel_patientID}" for="patientID" />
                    <h:inputText id="patientID" value="#{patientController.selected.patientID}" title="#{bundle.EditPatientTitle_patientID}" required="true" requiredMessage="#{bundle.EditPatientRequiredMessage_patientID}"/>
                    <h:outputLabel value="#{bundle.EditPatientLabel_firstNameE}" for="firstNameE" />
                    <h:inputText id="firstNameE" value="#{patientController.selected.firstNameE}" title="#{bundle.EditPatientTitle_firstNameE}" required="true" requiredMessage="#{bundle.EditPatientRequiredMessage_firstNameE}"/>
                    <h:outputLabel value="#{bundle.EditPatientLabel_secondNameE}" for="secondNameE" />
                    <h:inputText id="secondNameE" value="#{patientController.selected.secondNameE}" title="#{bundle.EditPatientTitle_secondNameE}" required="true" requiredMessage="#{bundle.EditPatientRequiredMessage_secondNameE}"/>
                    <h:outputLabel value="#{bundle.EditPatientLabel_lastNameE}" for="lastNameE" />
                    <h:inputText id="lastNameE" value="#{patientController.selected.lastNameE}" title="#{bundle.EditPatientTitle_lastNameE}" required="true" requiredMessage="#{bundle.EditPatientRequiredMessage_lastNameE}"/>
                    <h:outputLabel value="#{bundle.EditPatientLabel_firstNameA}" for="firstNameA" />
                    <h:inputText id="firstNameA" value="#{patientController.selected.firstNameA}" title="#{bundle.EditPatientTitle_firstNameA}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_secondNameA}" for="secondNameA" />
                    <h:inputText id="secondNameA" value="#{patientController.selected.secondNameA}" title="#{bundle.EditPatientTitle_secondNameA}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_lastNameA}" for="lastNameA" />
                    <h:inputText id="lastNameA" value="#{patientController.selected.lastNameA}" title="#{bundle.EditPatientTitle_lastNameA}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_birthDate}" for="birthDate" />
                    <h:inputText id="birthDate" value="#{patientController.selected.birthDate}" title="#{bundle.EditPatientTitle_birthDate}" required="true" requiredMessage="#{bundle.EditPatientRequiredMessage_birthDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditPatientLabel_homeTele}" for="homeTele" />
                    <h:inputText id="homeTele" value="#{patientController.selected.homeTele}" title="#{bundle.EditPatientTitle_homeTele}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_homeTeleExt}" for="homeTeleExt" />
                    <h:inputText id="homeTeleExt" value="#{patientController.selected.homeTeleExt}" title="#{bundle.EditPatientTitle_homeTeleExt}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_workTele}" for="workTele" />
                    <h:inputText id="workTele" value="#{patientController.selected.workTele}" title="#{bundle.EditPatientTitle_workTele}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_workTeleExt}" for="workTeleExt" />
                    <h:inputText id="workTeleExt" value="#{patientController.selected.workTeleExt}" title="#{bundle.EditPatientTitle_workTeleExt}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_mobileNo}" for="mobileNo" />
                    <h:inputText id="mobileNo" value="#{patientController.selected.mobileNo}" title="#{bundle.EditPatientTitle_mobileNo}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_independentID}" for="independentID" />
                    <h:inputText id="independentID" value="#{patientController.selected.independentID}" title="#{bundle.EditPatientTitle_independentID}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_relationID}" for="relationID" />
                    <h:inputText id="relationID" value="#{patientController.selected.relationID}" title="#{bundle.EditPatientTitle_relationID}" />
                    <h:outputLabel value="#{bundle.EditPatientLabel_comapny}" for="comapny" />
                    <h:inputText id="comapny" value="#{patientController.selected.comapny}" title="#{bundle.EditPatientTitle_comapny}" />
                </h:panelGrid>
                <h:commandLink action="#{patientController.update}" value="#{bundle.EditPatientSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditPatientViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{patientController.prepareList}" value="#{bundle.EditPatientShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditPatientIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
